//
//  UIButton+MGTButton.m
//  PageManagerTest
//
//  Created by rainimute on 16/7/14.
//  Copyright © 2016年 你问我答. All rights reserved.
//

#import "UIButton+MGTButton.h"

@implementation UIButton (MGTButton)


- (void)setUpButtonWithNormolTitle:(NSString *)normolTitle selectedTitle:(NSString *)selectedTitle normolTitleSize:(CGFloat)normolTitleSize selectedTitleSize:(CGFloat)selectedTitleSize normolTitleColor:(UIColor *)normolTitleColor selectedTitleColor:(UIColor *)selectedTitleColor normolBcakImage:(UIImage *)normolBackImage selectedBackImage:(UIImage *)selectedBackImage actionSEL:(SEL)buttonSEL target:(id)target{
    [self setTitle:normolTitle forState:UIControlStateNormal];
    [self setTitleColor:normolTitleColor forState:UIControlStateNormal];
    [self setBackgroundImage:normolBackImage forState:UIControlStateNormal];
    
    [self setTitle:selectedTitle forState:UIControlStateSelected];
    [self setTitleColor:selectedTitleColor forState:UIControlStateSelected];
    [self setBackgroundImage:selectedBackImage forState:UIControlStateSelected];
    self.titleLabel.font = [UIFont systemFontOfSize:selectedTitleSize];
    
    if ([target respondsToSelector:buttonSEL]) {
        [self addTarget:target action:buttonSEL forControlEvents:UIControlEventTouchUpInside];
    }
}

@end
